Skip to content

Conversation

@tqchen
Copy link
Member

@tqchen tqchen commented Nov 21, 2018

No description provided.

[TOPI] Fix atlest1d for reduce and squeeze
*/
// Enforce TOPI to use old behavior that reduces to at least 1d
#define TOPI_REDUCE_ATLEAST1D 1
#define TOPI_OUTPUT_ATLEAST1D 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, adding atleast1d is correct, but I don't see reasons for making its default values different in different object files. It takes time to understand that TOPI_OUTPUT_ATLEAST1D is defined above headers in two places with different values.

I would suggest to make atleast1d parameters with fixed default value of 0 to represent numpy-like behavior, but pass 1 to every call made from NNVM to keep backward compatibility.
Alternatively, one may define atleast1d without default value and let compiler point us all the places it should be set.

@tqchen
Copy link
Member Author

tqchen commented Nov 21, 2018

Thanks, @grwlf for the suggest, I agree you are right and have changed the code accordingly

@tqchen tqchen merged commit f3ae3f2 into apache:master Nov 21, 2018
siju-samuel added a commit to siju-samuel/tvm that referenced this pull request Nov 22, 2018
siju-samuel added a commit to siju-samuel/tvm that referenced this pull request Nov 22, 2018
@alexeyr
Copy link
Contributor

alexeyr commented Nov 22, 2018

If atleast1d was exposed as an optional parameter in Python too (both in TVM and NNVM), it would simplify #2105.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants